package date;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class DateParser {

	static public Date toDate(String strDate)
	{
        SimpleDateFormat sdf = new SimpleDateFormat("dd MM yyyy HH:mm:ss zzz");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
      
	    try {
	       return sdf.parse(strDate);
	    } catch (Exception ex) {
	        System.out.println(ex.getMessage());
	    }     
		return null;	
	}
	
	static public String toString(Date date)
	{
		java.sql.Timestamp t = new java.sql.Timestamp(date.getTime());
		SimpleDateFormat sdf = new SimpleDateFormat("dd MM yyyy HH:mm:ss zzz");
		sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
		return sdf.format(date);		 
	}
		
}
